import $http from '@/utils/request'

// custom部分参数说明: 
// isShowLoading: 请求时是否显示loadding, 默认为 true
// isShowErrorMsg: 请求出错时是否显示错误信息, 默认为 true
// isIntercept: 请求成功时返回状态码returnCode不为1000时,是否拦截前端返回, 默认为true

export function getByOwn(params){  //获取登陆用户自己的用户信息
	return $http.get('/rfdt/userProfile/getByOwn', { data: params, custom:{ isShowErrorMsg: false, isShowLoading:false } })
}

export function userProfileAdd(params){  //康复案例新增
	return $http.request({
		method:"POST",
		url:"/rfdt/userProfile/add",
		data: params,
		custom:{
			loadingText: '新增中'
		}
	})
}

export function userProfileEdit(params){  //康复案例修改
	return $http.request({
		method:"PUT",
		url:"/rfdt/userProfile/update",
		data: params,
		custom:{
			loadingText: '修改中'
		}
	})
}

export function getOwnList(params){  //获取用户自己得求助分页列表
	return $http.get('/rfdt/seekHelp/getOwnList', { data: params })
}

export function seekHelpList(params){  //获取求助分页列表
	return $http.get('/rfdt/seekHelp/list', { data: params })
}

export function seekHelpGetById(params){  //获取求助通过主键id查找
	return $http.get('/rfdt/seekHelp/getById', { data: params,custom: { loadingText: '查询中'} })
}

export function seekHelpReply(params){  //医生回复求助
	return $http.request({
		method:"POST",
		url:"/rfdt/seekHelp/reply",
		data: params,
		custom:{
			isShowLoading: false,
			isShowErrorMsg: false
		}
	})
}

export function unclaimedList(params){  //获取分页列表(待领取) 
	return $http.get('/rfdt/caseRecure/unclaimedList', { data: params })
}

export function auditList(params){  //获取分页列表(待核实) 
	return $http.get('/rfdt/caseRecure/auditList', { data: params })
}

export function getIsVerifyList(params){  //获取分页列表(已核实) 
	return $http.get('/rfdt/caseRecure/getIsVerifyList', { data: params })
}

export function verifyList(params){  //获取分页列表(待鉴定) 
	return $http.get('/rfdt/caseRecure/verifyList', { data: params })
}

export function finishedList(params){  //获取分页列表(已鉴定) 
	return $http.get('/rfdt/caseRecure/finishedList', { data: params })
}

export function caseAppraisalAdd(params){  //领取鉴定案例任务
	return $http.request({
		method:"POST",
		url:"/rfdt/caseAppraisal/add",
		data: params,
		custom:{
			loadingText: '领取中'
		}
	})
}

export function finishedAppraisal(params){  //完成鉴定
	return $http.request({
		method:"PUT",
		url:"/rfdt/caseAppraisal/finishedAppraisal",
		data: params,
		custom:{
			loadingText: '提交中'
		}
	})
}

export function auditCase(params){  //核实案列 
	return $http.request({
		method:"POST",
		url:"/rfdt/caseAppraisal/auditCase",
		data: params,
		custom:{
			loadingText: '鉴定中'
		}
	})
}

export function getUserAppraisal(params){  //获取登陆用户对某个案例的鉴定记录
	return $http.get('/rfdt/caseAppraisal/getUserAppraisal', { data: params })
}

export function periodGetAll(params){  //获取服务时间段
	return $http.get('/rfdt/period/getAll', { data: params,custom:{isShowLoading: false,isShowErrorMsg: false} })
}

export function purposeGetAll(params){  //获取服务方向
	return $http.get('/rfdt/purpose/getAll', { data: params,custom:{isShowLoading: false,isShowErrorMsg: false} })
}

export function userCollectionList(params){  //用户收藏
	return $http.get('/userCollection/getUserMethods', { data: params })
}

export function opinionAdd(params){  //新增意见反馈 
	return $http.request({
		method:"POST",
		url:"/opinion/add",
		data: params,
		custom:{
			loadingText: '新增意见中'
		}
	})
}